//
//  HMDetailViewController.swift
//  Weibo
//
//  Created by HM on 16/5/19.
//  Copyright © 2016年 itheima. All rights reserved.
//

import UIKit

class JHdetailViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.title = "\(navigationController?.childViewControllers.count ?? 0)"
        //设置背景色
        view.backgroundColor = UIColor.whiteColor()
//       
        
        //返回按钮的手势消失 
        //解决办法 在导航视图控制器中重新设置边缘返回手势的代理 
//        let back = UIBarButtonItem(imageName: "navigationbar_back_withtext", title: "返回", target: self, action: #selector(HMDetailViewController.back))
//        //设置自定义返回按钮
//        self.navigationItem.leftBarButtonItem = back
//        
        //进入多级页面
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next", style: .Plain, target: self, action: #selector(next))

        
    }
    
    @objc private func next() {
        let next = JHdetailViewController()
        navigationController?.pushViewController(next, animated: true)
    }
    
//    @objc private func back() {
//        navigationController?.popViewControllerAnimated(true)
//    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
